Package

Source Code of Test

import tokbox.com.opentok.api.API_Config;
import tokbox.com.opentok.api.OpenTokSDK;
import tokbox.com.opentok.api.constants.SessionProperties;
import tokbox.com.opentok.api.constants.RoleConstants;
import tokbox.com.opentok.exception.OpenTokException;

class Test {
  public static void main(final String argv[]) throws OpenTokException {
    final OpenTokSDK sdk = new OpenTokSDK(API_Config.API_KEY,API_Config.API_SECRET);

    //Generate a token
    final String s = sdk.generate_token("session");
    System.out.println(s);

    System.out.println(sdk.generate_token("session",RoleConstants.PUBLISHER));
    System.out.println(sdk.generate_token("session",RoleConstants.SUBSCRIBER));
    System.out.println(sdk.generate_token("session",RoleConstants.MODERATOR));



    //Generate a basic session
    System.out.println(sdk.create_session().session_id);

    System.out.println();

    //Generate Session Properties for a session
    final SessionProperties sp = new SessionProperties();
    sp.echoSuppression_enabled = true;

    //Generate a session with a location hint and session properties
    System.out.println(sdk.create_session("127.0.0.1", sp).session_id);
  }
}
TOP

Related Classes of Test

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.